package org.login;

import lombok.extern.slf4j.Slf4j;
import org.common.netty.NettyServer;
import org.login.handler.LoginToGameNettyHandler;
import org.login.handler.LoginNettyHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
@ComponentScan(basePackages = {"org.login", "org.common"})
public class LoginBeanConfig {

    /**
     * 对外的netty服务
     */
    @Bean("playerNettyServer")
    NettyServer getPlayerNettyServer() {
        LoginNettyHandler handler = new LoginNettyHandler();
        return new NettyServer(handler);
    }

    /**
     * 对内的netty服务
     */
    @Bean("innerNettyServer")
    NettyServer getInnerNettyServer() {
        LoginToGameNettyHandler handler = new LoginToGameNettyHandler();
        return new NettyServer(handler);
    }

}
